package com.example.judge.controller;

import com.example.api.entity.JudgeSubmitDTO;
import com.example.api.entity.UserQuestionResultVO;
import com.example.core.controller.BaseController;
import com.example.core.result.Res;
import com.example.judge.service.IJudgeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/judge")
@Slf4j
public class JudgeController extends BaseController {

    @Autowired
    private IJudgeService judgeService;

    @PostMapping("/doJudgeJavaCode")
    public Res<UserQuestionResultVO> doJudgeJavaCode(@RequestBody JudgeSubmitDTO judgeSubmitDTO) {
        return Res.ok(judgeService.doJudgeJavaCode(judgeSubmitDTO));
    }
}
